package com.tdh.tlgusers.service.impl;

import com.tdh.tlgusers.mapper.CollectMapper;
import com.tdh.tlgusers.pojo.Collect;
import com.tdh.tlgusers.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service
public class CollectServiceImpl implements CollectService {

    @Autowired
    private CollectMapper collectMapper;

    @Override
    public List<Collect> selCollects(Integer userId) {
        return collectMapper.selCollects(userId);
    }

    @Override
    public int delCollect(Integer collectId) {
        return collectMapper.delCollect(collectId);
    }

    @Override
    public int addCollect(Collect collect) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return collectMapper.addCollect(collect);
    }
}
